﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using WPFExcelReport.Helpers;
using System.ComponentModel;
namespace WPFExcelReport
{
    public partial class UIMCO : ViewBase
    {
        public VICC_ABPOS_MCO TMV
        {
            get
            {
                return (VICC_ABPOS_MCO)MV;
            }
        }
        #region ==PSS===========
        public static readonly DependencyProperty PSSProperty = DependencyProperty.Register("PSS",
        typeof(double), typeof(UIMCO),
        new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnPSSChanged));
        public double PSS
        {
            get
            {
                return (double)GetValue(PSSProperty);
            }
            set
            {
                SetValue(PSSProperty, value);
            }
        }
        private static void OnPSSChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIMCO;
            if (src != null)
            {
                src.PSS = (double)e.NewValue;
                src.OnPSSChg((double)e.NewValue);
            }
        }
        public virtual void OnPSSChg(double value)
        {
             
        }
        #endregion       
        public UIMCO()
        {
          
        } 

        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            if(dwMaster==null)
            {
                PSS = 0;
            }
            else
            {
                PSS = TMV.PSS;
            }
        }

     
    }
}
